<script setup lang="ts">
defineProps({
  money: {
    type: Number,
    default: 0,
  },
})
const emit = defineEmits<{
  (e: 'update:money', val: number): void
}>()
const cutMoney = () => {
  emit('update:money', 10)
}
</script>
<template>
  <div style="border: 1px solid #000; padding: 20px">
    我是子组件 - {{ money }}
    <button @click="cutMoney">花錢</button>
  </div>
</template>
<style scoped></style>
